// ****************************************************************************** 
// Copyright     :  Copyright (C) 2018, Hisilicon Technologies Co. Ltd.
// File name     :  io_c_union_define.h
// Project line  :  ICT
// Department    :  ICT Processor Chipset Development Dep
// Author        :  Huawei
// Version       :  1.0
// Date          :  2017/11/13
// Description   :  The description of Hi MINI project
// Others        :  Generated automatically by nManager V4.2 
// History       :  Huawei 2018/05/16 10:46:14 Create file
// ******************************************************************************

#ifndef __IO_C_UNION_DEFINE_H__
#define __IO_C_UNION_DEFINE_H__

/* Define the union U_USB_3D0_REG */
typedef union
{
    /* Define the struct bits */
    struct
    {
        unsigned int    usb_3d0_reg : 40  ; /* [39:0] */
    } bits;

    /* Define an unsigned member */
    unsigned int    u32;

} U_USB_3D0_REG;

/* Define the union U_SERDES_REG_1 */
typedef union
{
    /* Define the struct bits */
    struct
    {
        unsigned int    serdes_reg_1 : 40  ; /* [39:0] */
    } bits;

    /* Define an unsigned member */
    unsigned int    u32;

} U_SERDES_REG_1;

/* Define the union U_SERDES_REG_0 */
typedef union
{
    /* Define the struct bits */
    struct
    {
        unsigned int    serdes_reg_0 : 40  ; /* [39:0] */
    } bits;

    /* Define an unsigned member */
    unsigned int    u32;

} U_SERDES_REG_0;

/* Define the union U_BOOTROM_REG1 */
typedef union
{
    /* Define the struct bits */
    struct
    {
        unsigned int    bootrom_reg1 : 40  ; /* [39:0] */
    } bits;

    /* Define an unsigned member */
    unsigned int    u32;

} U_BOOTROM_REG1;

/* Define the union U_BOOTROM_REG0 */
typedef union
{
    /* Define the struct bits */
    struct
    {
        unsigned int    bootrom_reg0 : 40  ; /* [39:0] */
    } bits;

    /* Define an unsigned member */
    unsigned int    u32;

} U_BOOTROM_REG0;

/* Define the union U_RGMII_REG */
typedef union
{
    /* Define the struct bits */
    struct
    {
        unsigned int    rgmii_reg : 40  ; /* [39:0] */
    } bits;

    /* Define an unsigned member */
    unsigned int    u32;

} U_RGMII_REG;

/* Define the union U_PWM_REG */
typedef union
{
    /* Define the struct bits */
    struct
    {
        unsigned int    pwm_reg : 40  ; /* [39:0] */
    } bits;

    /* Define an unsigned member */
    unsigned int    u32;

} U_PWM_REG;

/* Define the union U_TIMER0_REG */
typedef union
{
    /* Define the struct bits */
    struct
    {
        unsigned int    timer0_reg : 40  ; /* [39:0] */
    } bits;

    /* Define an unsigned member */
    unsigned int    u32;

} U_TIMER0_REG;

/* Define the union U_SMBUS */
typedef union
{
    /* Define the struct bits */
    struct
    {
        unsigned int    smbus : 40  ; /* [39:0] */
    } bits;

    /* Define an unsigned member */
    unsigned int    u32;

} U_SMBUS;

/* Define the union U_I2C0_REG */
typedef union
{
    /* Define the struct bits */
    struct
    {
        unsigned int    i2c0_reg : 40  ; /* [39:0] */
    } bits;

    /* Define an unsigned member */
    unsigned int    u32;

} U_I2C0_REG;

/* Define the union U_GPIO0_REG */
typedef union
{
    /* Define the struct bits */
    struct
    {
        unsigned int    gpio0_reg : 40  ; /* [39:0] */
    } bits;

    /* Define an unsigned member */
    unsigned int    u32;

} U_GPIO0_REG;

/* Define the union U_SYSCTRL_REG */
typedef union
{
    /* Define the struct bits */
    struct
    {
        unsigned int    sysctrl_reg : 40  ; /* [39:0] */
    } bits;

    /* Define an unsigned member */
    unsigned int    u32;

} U_SYSCTRL_REG;

/* Define the union U_SPMI_REG */
typedef union
{
    /* Define the struct bits */
    struct
    {
        unsigned int    spmi_reg : 40  ; /* [39:0] */
    } bits;

    /* Define an unsigned member */
    unsigned int    u32;

} U_SPMI_REG;

/* Define the union U_SYSTEM_COUNTER */
typedef union
{
    /* Define the struct bits */
    struct
    {
        unsigned int    system_counter : 40  ; /* [39:0] */
    } bits;

    /* Define an unsigned member */
    unsigned int    u32;

} U_SYSTEM_COUNTER;

/* Define the union U_IOMUX_REG */
typedef union
{
    /* Define the struct bits */
    struct
    {
        unsigned int    iomux_reg : 40  ; /* [39:0] */
    } bits;

    /* Define an unsigned member */
    unsigned int    u32;

} U_IOMUX_REG;

/* Define the union U_DISP_REG */
typedef union
{
    /* Define the struct bits */
    struct
    {
        unsigned int    disp_reg : 40  ; /* [39:0] */
    } bits;

    /* Define an unsigned member */
    unsigned int    u32;

} U_DISP_REG;

/* Define the union U_SCHE_REG */
typedef union
{
    /* Define the struct bits */
    struct
    {
        unsigned int    sche_reg : 40  ; /* [39:0] */
    } bits;

    /* Define an unsigned member */
    unsigned int    u32;

} U_SCHE_REG;

/* Define the union U_FTE_REG */
typedef union
{
    /* Define the struct bits */
    struct
    {
        unsigned int    fte_reg : 40  ; /* [39:0] */
    } bits;

    /* Define an unsigned member */
    unsigned int    u32;

} U_FTE_REG;

/* Define the union U_SMMU_REG3 */
typedef union
{
    /* Define the struct bits */
    struct
    {
        unsigned int    smmu_reg3 : 40  ; /* [39:0] */
    } bits;

    /* Define an unsigned member */
    unsigned int    u32;

} U_SMMU_REG3;

/* Define the union U_SMMU_REG2 */
typedef union
{
    /* Define the struct bits */
    struct
    {
        unsigned int    smmu_reg2 : 40  ; /* [39:0] */
    } bits;

    /* Define an unsigned member */
    unsigned int    u32;

} U_SMMU_REG2;

/* Define the union U_SMMU_REG1 */
typedef union
{
    /* Define the struct bits */
    struct
    {
        unsigned int    smmu_reg1 : 40  ; /* [39:0] */
    } bits;

    /* Define an unsigned member */
    unsigned int    u32;

} U_SMMU_REG1;

/* Define the union U_SMMU_REG0 */
typedef union
{
    /* Define the struct bits */
    struct
    {
        unsigned int    smmu_reg0 : 40  ; /* [39:0] */
    } bits;

    /* Define an unsigned member */
    unsigned int    u32;

} U_SMMU_REG0;

/* Define the union U_SRAM */
typedef union
{
    /* Define the struct bits */
    struct
    {
        unsigned int    sram : 40  ; /* [39:0] */
    } bits;

    /* Define an unsigned member */
    unsigned int    u32;

} U_SRAM;


//==============================================================================
/* Define the global struct */
typedef struct
{
    volatile U_USB_3D0_REG    USB_3D0_REG    ; /* 110600000 */
    volatile U_SERDES_REG_1   SERDES_REG_1   ; /* 110510000 */
    volatile U_SERDES_REG_0   SERDES_REG_0   ; /* 110500000 */
    volatile U_BOOTROM_REG1   BOOTROM_REG1   ; /* 110430000 */
    volatile U_BOOTROM_REG0   BOOTROM_REG0   ; /* 110420000 */
    volatile U_RGMII_REG      RGMII_REG      ; /* 110400000 */
    volatile U_PWM_REG        PWM_REG        ; /* 1101A0000 */
    volatile U_TIMER0_REG     TIMER0_REG     ; /* 110150000 */
    volatile U_SMBUS          SMBUS          ; /* 110140000 */
    volatile U_I2C0_REG       I2C0_REG       ; /* 110130000 */
    volatile U_GPIO0_REG      GPIO0_REG      ; /* 110100000 */
    volatile U_SYSCTRL_REG    SYSCTRL_REG    ; /* 1100C0000 */
    volatile U_SPMI_REG       SPMI_REG       ; /* 1100A0000 */
    volatile U_SYSTEM_COUNTER SYSTEM_COUNTER ; /* 110090000 */
    volatile U_IOMUX_REG      IOMUX_REG      ; /* 110080000 */
    volatile U_DISP_REG       DISP_REG       ; /* 110060000 */
    volatile U_SCHE_REG       SCHE_REG       ; /* 110050000 */
    volatile U_FTE_REG        FTE_REG        ; /* 110040000 */
    volatile U_SMMU_REG3      SMMU_REG3      ; /* 110030000 */
    volatile U_SMMU_REG2      SMMU_REG2      ; /* 110020000 */
    volatile U_SMMU_REG1      SMMU_REG1      ; /* 110010000 */
    volatile U_SMMU_REG0      SMMU_REG0      ; /* 110000000 */
    volatile U_SRAM           SRAM           ; /* 112000000 */

} S_io_REGS_TYPE;

/* Declare the struct pointor of the module io */
extern volatile S_io_REGS_TYPE *gopioAllReg;

/* Declare the functions that set the member value */
int iSetUSB_3D0_REG_usb_3d0_reg(unsigned int uusb_3d0_reg);
int iSetSERDES_REG_1_serdes_reg_1(unsigned int userdes_reg_1);
int iSetSERDES_REG_0_serdes_reg_0(unsigned int userdes_reg_0);
int iSetBOOTROM_REG1_bootrom_reg1(unsigned int ubootrom_reg1);
int iSetBOOTROM_REG0_bootrom_reg0(unsigned int ubootrom_reg0);
int iSetRGMII_REG_rgmii_reg(unsigned int urgmii_reg);
int iSetPWM_REG_pwm_reg(unsigned int upwm_reg);
int iSetTIMER0_REG_timer0_reg(unsigned int utimer0_reg);
int iSetSMBUS_smbus(unsigned int usmbus);
int iSetI2C0_REG_i2c0_reg(unsigned int ui2c0_reg);
int iSetGPIO0_REG_gpio0_reg(unsigned int ugpio0_reg);
int iSetSYSCTRL_REG_sysctrl_reg(unsigned int usysctrl_reg);
int iSetSPMI_REG_spmi_reg(unsigned int uspmi_reg);
int iSetSYSTEM_COUNTER_system_counter(unsigned int usystem_counter);
int iSetIOMUX_REG_iomux_reg(unsigned int uiomux_reg);
int iSetDISP_REG_disp_reg(unsigned int udisp_reg);
int iSetSCHE_REG_sche_reg(unsigned int usche_reg);
int iSetFTE_REG_fte_reg(unsigned int ufte_reg);
int iSetSMMU_REG3_smmu_reg3(unsigned int usmmu_reg3);
int iSetSMMU_REG2_smmu_reg2(unsigned int usmmu_reg2);
int iSetSMMU_REG1_smmu_reg1(unsigned int usmmu_reg1);
int iSetSMMU_REG0_smmu_reg0(unsigned int usmmu_reg0);
int iSetSRAM_sram(unsigned int usram);

#endif // __IO_C_UNION_DEFINE_H__
